package com.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.entity.Tuser;
import com.util.JdbcUtil;

public class UserDaoImp implements UserDaoInt {

	@Override
	public boolean addUser(Tuser user) {
		try {
			Connection con = JdbcUtil.getCon();
			PreparedStatement pst = con.prepareStatement("insert into tbl_user values(?,?)");
			pst.setString(1, user.getUname());
			pst.setString(2, user.getPwd());
			return pst.executeUpdate() ==1;
		} catch (ClassNotFoundException | SQLException e) {
			e.printStackTrace();
		}
		return false;
	}
}
